翻訳と辞書
Words near each other
・ Installment credit
・ Installment loan
・ Installment note
・ Installment sale
・ Installment sales method
・ InstallShield
・ Installware
・ Installwatch
・ Instalment
・ InstaLoad
・ Instamatic
・ Instamojo
・ Instance (computer science)
・ Instance Cause
・ Instance dungeon
Instance variable
・ Instance vx
・ Instance-based learning
・ Instances of subliminal messages
・ Instancing
・ Instant
・ Instant (album)
・ Instant 0 in the Universe
・ Instant answer
・ Instant Armadillo Blues
・ Instant Brain
・ Instant breakfast
・ Instant camera
・ Instant Cash
・ Instant centre of rotation


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Instance variable : ウィキペディア英語版
Instance variable

In object-oriented programming with classes, an instance variable is a variable defined in a class (i.e. a member variable), for which each instantiated object of the class has a separate copy, or instance. An instance variable is similar to a class variable.
An instance variable is not a class variable although there are similarities. It is a type of class attribute (or class property, field, or data member). The same dichotomy between ''instance'' and ''class'' members applies to methods ("member functions") as well; a class may have both instance methods and class methods.
Each class variable and instance variable you invoke with the object lives in memory for the life of that object.
Variables are properties an object knows about itself. All instances of an object have their own copies of instance variables, even if the value is the same from one object to another. One object instance can change values of its instance variables without affecting all other instances. Instance variables can be used by all methods of a class unless the method is declared as static.
==Example==


struct Request ;
int Request::count1 = 0;

In this C++ example, the instance variable Request::number is a copy of the class variable Request::count1 where each instance constructed is assigned a sequential value of count1 before it is incremented. Since number is an instance variable, each Request object contains its own distinct value; in contrast, there is only one object Request::count1 available to all instances with the same value.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Instance variable」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.